package com.ctrip.study.java.classLoader;

public class MyClassLoader {

	public static void main(String[] args) {
		ClassLoader classLoader = Thread.currentThread()
				.getContextClassLoader();
		while (classLoader != null) {
			System.out.println(classLoader);
			classLoader = classLoader.getParent();
		}
		System.out.println(A.value); // 输出100
	}

	private static class B {
		static int value = 100;
		static {
			System.out.println("Class B is initialized."); // 输出
		}
	}

	private static class A extends B {
		static {
			System.out.println("Class A is initialized."); // 不会输出
		}
	}

}
